<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="applicable-device" content="pc" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Cache-Control" content="no-transform" />
<title>${dishesEntity.name }-${dishesEntity.summary }</title>
<meta name="keywords" content="${dishesEntity.summary }" />
<meta name="description" content="${dishesEntity.summary } " />
<link href="<%=path %>/css/index.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/css/common1.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/css/replay.css?ver=1.11" rel="stylesheet" type="text/css" />
<link href="<%=path %>/css/button.css" rel="stylesheet" type="text/css" />
    
<script type="text/javascript" src="<%=path %>/js/jquery-1.12.4.min.js"></script>
<link href="<%=path %>/css/dishesDetail.css?ver=1" rel="stylesheet"
	type="text/css" />
<script type="text/javascript" src="<%=path%>/js/jquery-form.js"></script>
<script type="text/javascript" src="<%=path%>/js/global.js"></script>
	
<style>
.artical {
	margin: 0 176.500;
}

.articale_title {
	font-size: 48px;
	font-weight: 700;
	color: #2F4050;
	text-align: center;
}

.artical_content {
	font-size: 15px;
	line-height: 26px;
}

.artical_content img {
	width: 100%;
}

.artical_msg {
	text-align: center;
}

.img_topic {
	width: auto;
	height: 250px;
	max-width: 100%;
	max-height: 100%;
}

.hr_2 {
	
}
</style>


<script type="text/javascript">

	$(function (){
		$("#content").on("focus",function(){
		    this.scrollIntoView();
		});
	});
	function submitData(){
		
		
		var url = "<%=path %>/business/replayDis";
		var action = $('#replay_form').serializeArray();
		var result = ajaxWithServer(url,action);
		
		if(result.result){
			if(result.data.addResult == 'SUCCESS'){
				window.location.reload();//当前页面 
			}else {
				alert(result.data.errorMsg);
			}
		}else{
			alert("您还没有登陆，请登陆后在评论。");
		}
	}

	function replay_this(targetName){
		var textarea = $('#content');
		textarea.html("@"+targetName+"  ");
		textarea.focuse();
	}
</script>





</head>

<body>
	<!--头部-->
	<jsp:include page="../include/head.jsp">
		<jsp:param value="content" name="head" />
	</jsp:include>

	<!--导航-->
	<jsp:include page="../include/nav.jsp">
		<jsp:param value="content" name="nav" />
	</jsp:include>


	<div class="h10"></div>
	<div class="h10"></div>
	<div class="h10"></div>


	<div class="artical" id="artical_div">
		<div class="details_food">
			<div class="d-left">
				<div class="name">
					 ${dishesEntity.name }<br/>&nbsp;
				</div>
				<div class="address">
					<p>
						<span>
							单价&nbsp;&nbsp;￥${dishesEntity.price } </span>
					</p>
					<p>商家： （${dishesEntity.user.nickName }）</p>
					<p>
						地址： ${dishesEntity.user.address } <b></b>
					</p>
					<p>电话： ${dishesEntity.user.telPhone }</p>
					<p>营业时间： ${dishesEntity.user.workTime }</p>
				</div>
			</div>
			<div class="d-right">
				<div class="big">
					<div class="imgbox" style="height: 250px; width: 100%;">
						<!-- <img
							src="http://p0.meituan.net/mogu/7f102559bd246c78d7f2d2ab066a12d0139144.jpg@380w_214h_1e_1c"> -->
						<img width="400" height="250" src="<%=path %>/${dishesEntity.topPic}">
					</div>
				</div>
			</div>
			<div class="h10"></div>
		<div class="h10"></div>
		<div id="artical_msg" class="artical_msg"></div>
		<div class="h10"></div>
		<div id="artical_content" class="artical_content">
				<br/>${dishesEntity.disheDetail}
		</div>
	</div>

	</div>
<div class="h10"></div>
		<div class="h10"></div>
	<div class="artical" >
		<div class="details_food replay_box" >
			<h2>评论列表</h2>
			<br/>
			<hr/>
			<br/>
			<br/>
		
				<div id="replay_box">
					<c:choose>
						<c:when test="${replayInformationEntities !=null and fn:length(replayInformationEntities)>0}">
							<c:forEach items="${replayInformationEntities }" var="replayInfo" varStatus="abc">
								
								<div class="story">
									<div class="opbtn">
									</div>
									<p class="title_">
										<span class="story_t">${replayInfo.user.nickName } </span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
											class="story_time"> ${replayInfo.createTime } </span>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="story_ceng"> ${abc.index}楼 </span>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" class="replay_a" onclick="replay_this('${replayInfo.user.nickName }')">回复</a>
									</p>
									<p class="story_m">
										${replayInfo.content }
									</p>
										<div class="h10"></div>
								</div>
								<div class="h10"></div>
	<div class="h10"></div>
							</c:forEach>
						</c:when>
						
						<c:otherwise>
							<p class="replay_empty"> 还没有评论哦 ^_^</p>
						</c:otherwise>
					</c:choose>
				</div>
				<br/>
				<br/>
				<br/>
				<hr/>
				<div >
					<form  method="post"  id="replay_form">
						<input type="hidden" name="targetId" id="targetId" value="${dishesEntity.id }"/>
						<input type="hidden" name="replayType" id="replayType" value="2"/>
						
						<textarea name="content" class="news_show_ly5_foes" id="content" placeholder ="请输入您的评论或回复"></textarea>
						<div class="input_right"><input type="button" class="btn_primary btn_b"  onclick="submitData()"  value="提交"></div>
					</form>
				</div>
			<br/>
			
		</div>
		
	</div>	



</body>
</html>
